package com.trxy.config;

import com.alipay.api.AlipayConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PayConfig {
    @Bean
    public AlipayConfig alipayConfig() {
        //应用的私钥
        String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCWVY6xxjGvo1Wi+YT7E0JaHbprnP94/ipNe1N6uD3AU9hsFROJceMmYi0SIu5G68gul1K3M0z/SX7mARaModFGui4ZMAEB7ErS5dACeTWnw23Znjk7EedlQjSjspYuKJh7Rlb1PYzKzOMTG+shWoY6YB8eITA+ZON/35t5GolJb1DTH0cf8ykW5auhtygkWD3l+pLER9lw+jTRP2/4v2mVI+m7tVbQTc6T8sWdRworr/IhvsrBju/+ez9ZXSDyUWGExf9bS0sVPTA6f58v/RJOY439Y3r2HQViVMphrBtO6ObmXrwTzWBlpAyeeK9nb1m9gF3QW/6c5JrzGUtD2UxdAgMBAAECggEAWNi/uHj1rGPPnL3yxaAgOroPDsJ+ibdMsPYN5B03AY+L/HSIU1andGvZTzqtr+RxLnfoPrVm8AkzoiNKfFq2ICKwU9p2/ff0UKfZQ1z3ROrO5SoJkMuIAeQa0BQfhbAgTdrIUa/KoaBtI0IAuHmTkrR0L45VwMpHWa+BZxUzxd3EoF1eKplLdv5W8EIb1LIyuW3eTj5ZhqjKeqeS+qYJCT5uC0JYwU/4vf+WbVIU8SMidcZLK1Jy/aZ97N2yBvx/3OJ14WL6GRNzX+L2ybtuvkwOdu2aFnO//pGSrJkKlK/AvMN9VacP9HCEbZKayK3lAHTn+94FhostWnjDSCcB0QKBgQDocxl54EdQJnUdFvtRIjBoFTpbOBXF+WGQYVz5+ADAsO4XB0/JMrHOoI/e/TarvPV8j9W3e1BgsWS3ybJFvwGxdbPBn49+SCZ0+TvPeGpUD8IXdELcLzl6drj8yOSDsRrRvtiQz6ncEaGfv+LjjUJfItx7i5EreXzx8Qa1ceXD3wKBgQClkK6XmyaPM5SbB6xYuLk/n4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DAQAB";

        AlipayConfig alipayConfig = new AlipayConfig();
        alipayConfig.setServerUrl("https://openapi.alipaydev.com/gateway.do");
        alipayConfig.setAppId("2021000118659713");
        alipayConfig.setPrivateKey(privateKey);
        alipayConfig.setFormat("json");
        alipayConfig.setAlipayPublicKey(alipayPublicKey);
        alipayConfig.setCharset("UTF8");
        alipayConfig.setSignType("RSA2");
        return alipayConfig;
    }
}
